<template>
    <div class="ph-check-group"><slot></slot></div>
</template>
<script lang="ts">
import { defineComponent, provide, toRef } from 'vue'
interface Opt{
    checked:boolean,
    value:string|number
}
export default defineComponent({
    props:{
        disabled:{type:Boolean,default:false},
        value:{
            type:[String,Number]
        }
    },
    setup(props,{emit}) {
        const update = (opt:Opt)=>{
            emit("change",opt.checked?opt.value:'')
        }
        provide("phcvalue",toRef(props,'value'))
        provide("update",update)
        provide("disabled",toRef(props,'disabled'))
    },
})
</script>
<style lang="scss">
@import '../check.scss';
</style>
